import turtle as t
import random as r

# 定义笔头大小
def drawsnow():
    t.ht()  # 隐藏笔头  ht = hideturtle
    t.pensize(2)
    for i in range(50):
        t.pencolor("pink")
        t.pu()
        t.setx(r.randint(-350, 350))
        t.sety(r.randint(1, 350))
        t.pd()
        dens = 6
        snowsize = r.randint(2, 12)
        for j in range(dens):
            t.fd(int(snowsize))
            t.backward(int(snowsize))
            t.right(int(360 / dens))

# 画地面线
def drawgroud():
    t.ht()
    for i in range(r.randint(10, 15)):
        x = r.randint(-400, 350)
        y = r.randint(-280, -1)
        t.pencolor("pink")
        t.pu()
        t.goto(x, y)
        t.pd()
        t.fd(r.randint(40, 100))


t.setup(800, 600, 200, 200)
t.tracer(True)

# 画雪
t.bgcolor("white")
# lightblue = #B0E0E6
t.speed(0.1)
drawsnow()
drawgroud()
t.done()
